home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Drivin' Route 66
/
Drivin' Route 66 (1995)(Creative Multimedia)[Mac-PC].iso
/
mac
/
RTMM.DIR
/
00544_Script_TRIP CODE
< prev
next >
Wrap
Text File
|
1995-10-03
|
6KB
|
240 lines
on ShowTrip
global filerPath,gtheState,gtheSite,realSiteNum
put the name of cast (the castNum of sprite 1) into test
if char 1 of test = "u" then
put calcTPText() into gtheSite
else
put findStateNumber() into gtheState
put -1 into gtheSite -- Always at top
end if
if length(filerPath) = 0 then
makeAFile "Empty.","MyTrip66.doc"
end if
doTripSite -1
repeat with s = 33 to 39
set the visible of sprite s to true
end repeat
updateStage
end
on calcTPText
put findSite() into x
put item 2 of line x of field "sitepatch" into temp
return integer(temp)
end
on hideTrip
put 0 into wasThere
repeat with s = 33 to 39
if the visible of sprite s then
put 1 into wasThere
puppetSprite s,1
set the visible of sprite s to false
end if
end repeat
if wasThere then
updateStage
repeat with s = 33 to 39
puppetSprite s,0
end repeat
end if
end
on siteToTown input -- WRONG!!!
return input
end
on clearItinerary
global gtheState,gtheSite
put 1 into gtheState
put 1 into gtheSite
repeat with i = 1 to 10
put empty into field ("itinerary" & string(i))
end repeat
put empty into field "itinerary"
end
on buildItinerary
put empty into field "itinerary"
repeat with i = 1 to 10
put return & field ("itinerary" & string(i)) after field "itinerary"
end repeat
set the textFont of field "itinerary" to "geneva"
set the textSize of field "itinerary" to 9
end
on addThis -- don't do it twice
global gtheState,gtheSite
if field "itinerary" contains (line 1 of field "tpw") then
nothing
else
put return & field "tpw" after field ("itinerary" & string(gtheState))
buildItinerary
makeAFile field "itinerary","MyTrip66.txt"
end if
end
on makeAFile theText,theName
global filer,filerPath
if filer > 0 then filer(mDispose)
if length(theText) > 0 AND length(theName) > 0 then
if the machineType = 256 then
openXLib "fileio.dll"
end if
if length(filerPath) = 0 then
put fileio(mNew,"?write",theName) into filer
else
put fileio(mNew,"write",filerPath) into filer
end if
if filer > 0 then
put filer(mFileName) into filerPath
filer(mWriteString,theText)
filer(mDispose)
else
end if
if the machineType = 256 then
closeXLib "fileio.dll"
end if
end if
end
------------------------------------
on doTripSite dir
global gtheState,gtheSite
if gtheState = 0 then put 1 into gtheState
if gtheSite = 0 then put 1 into gtheSite
--
if dir = 1 then
if gtheSite = -1 then
put 1 into gtheSite
else
put gtheSite+1 into gtheSite
end if
else if dir = 0 then
-- if we're in a state map, it's okay to go back to top
if the frame < 61 then
if gtheSite = 1 then
put -1 into gtheSite
else
put gtheSite-1 into gtheSite
if gtheSite < -1 then
put -1 into gtheSite
end if
end if
else
put gtheSite-1 into gtheSite
end if
if gtheSite = 0 then
put 1 into gtheSite
end if
else
if the frame < 61 then
put gtheSite+0 into gtheSite -- nuthin
else
if gtheSite < 1 then
put 1 into gtheSite
end if
end if
end if
put gtheState into x
put gtheSite into y
put getText(x,y) into temp
if temp = "end of this state" then
put gtheSite - 1 into gtheSite
else if temp = "top of state" then
put gtheSite + 1 into gtheSite
else
put temp into field "tpw"
end if
end
on getText whichState,whichItem
global outOfGas, gtheState
if whichItem < 0 then
put whichItem+1 into whichItemL
if whichItemL < 1 then put 1 into whichItemL
put gtheState & "," & whichItemL into tc
put the text of cast tc into temp
return temp
else if whichItem < 1 then
return "top of state"
end if
put whichItem+1 into whichItemL
put gtheState & "," & whichItemL into tc
put integer(MycheckBounds(integer(gtheState), integer(whichItemL))) into isCool
if isCool then
put the text of cast tc into temp
return temp
else
return "end of this state"
end if
end
On MycheckBounds thestate, theSite
If (thestate=1 and theSite>40) then
return 0
else if (thestate=2 and theSite>25) then
return 0
else if (thestate=3 and theSite>4) then
return 0
else if (thestate=4 and theSite>31) then
return 0
else if (thestate=5 and theSite>9) then
return 0
else if (thestate=6 and theSite>14) then
return 0
else if (thestate=7 and theSite>21) then
return 0
else if (thestate=8 and theSite>19) then
return 0
else
return 1
end if
end
On checkBounds
global gthestate, outofGas, gtheSite
If (gthestate=1 and gtheSite>=40) then
set outOfGas to "yes"
else if (gthestate=2 and gthesite>=25) then
set outOfGas to "yes"
else if (gthestate=3 and gthesite>=4) then
set outOfGas to "yes"
else if (gthestate=4 and gthesite>=31) then
set outOfGas to "yes"
else if (gthestate=5 and gthesite>=9) then
set outOfGas to "yes"
else if (gthestate=6 and gthesite>=14) then
set outOfGas to "yes"
else if (gthestate=7 and gthesite>=21) then
set outOfGas to "yes"
else if (gthestate=8 and gthesite>=19) then
set outOfGas to "yes"
else
set outOfGas to "no"
end if
end
--Illinois=1, whichItem<=40
--Missouri=2, whichItem<=25
--Kansas=3, whichItem<=4
--Oklahoma=4, whichItem<=31
--Texas=5, whichItem<=9
--New Mexico=6, whichItem<=14
--Arizona=7, whichItem<=21
--California=8, whichItem<=19